package com.zhongge.heap;

import java.util.Arrays;

/**
 * @ClassName TestMyHeap
 * @Description TODO 测试堆
 * @Author zhongge
 * @Date 2025/9/7 1:46
 * @Version 1.0
 */
public class TestMyHeap {
    public static void main(String[] args) {
        int[] array = {27,15,19,18,28,34,65,49,25,37};
        MyHeap heap = new MyHeap();
//        heap.createCplBinTree(array);
//
//        heap.createMaxHeap();
//
//        heap.offer(80);
//        for (int i = 0; i < array.length; i++) {
//            heap.offer(array[i]);
//        }

//        System.out.println(heap.poll());

        int[] arr = {10,9,8,7,6,5,4,3,2,1};
        System.out.println("排序前：" + Arrays.toString(arr));

        heap.heapSort(arr);
        System.out.println("排序后：" + Arrays.toString(heap.getElem()));
    }
}
